package org.zhu.common.bean;


import org.zhu.common.bean.enums.MessageType;

/**
 * Created by zhu yingzhi on 2017/10/12.
 * @author yingzhi zhu
 * 消息实体类
 */
public class Message {
    /**
     * 自增
     */
    private Long id;
    /**
     * 是否读
     */
    private boolean is_read; 
    /**
     * 消息内容
     */
    private String message;
    /**
     * 
     */
    private String add_time;
    /**
     * 消息类别
     */
    private MessageType message_type;
    /**
     * 发送者
     */
    private String sender;


    public Message() {
    }

    public Message(String message, String add_time, MessageType message_type, String sender) {
        this.message = message;
        this.add_time = add_time;
        this.message_type = message_type;
        this.sender = sender;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public boolean isIs_read() {
        return is_read;
    }

    public void setIs_read(boolean is_read) {
        this.is_read = is_read;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public String getAdd_time() {
        if (add_time!=null && add_time.contains(".0")){
            add_time = add_time.substring(0,add_time.length()-2);
        }
        return add_time;
    }

    public void setAdd_time(String add_time) {
        this.add_time = add_time;
    }

    public MessageType getMessage_type() {
        return message_type;
    }

    public void setMessage_type(MessageType message_type) {
        this.message_type = message_type;
    }

    public String getSender() {
        return sender;
    }

    public void setSender(String sender) {
        this.sender = sender;
    }
}
